package hn.cch.layui_admin.controller;

import hn.cch.layui_admin.Message.QueryRequest;
import hn.cch.layui_admin.Message.TableResponse;
import hn.cch.layui_admin.service.ParamService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@RequestMapping(value = "/param/")
@Controller
public class ParamController {

    private static Logger logger = LoggerFactory.getLogger(ParamController.class);


    @Autowired
    private ParamService paramService;


    @RequestMapping(value = "table")
    @ResponseBody
    public TableResponse table(QueryRequest queryRequest) {
        logger.info("table");
        logger.info("page={}", queryRequest.getPage());
        logger.info("limit={}", queryRequest.getLimit());

        return paramService.selectParam(queryRequest);
    }

}
